<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
	prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
	prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"
	prefix="logic"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>JSP for ModifyatomForm form</title>
		<LINK href="css/default.css" rel=stylesheet>

		<style type="text/css">
#id1 {
	width: 100%;
	height: 100%;
	background-color: #000;
	FILTER: alpha(opacity =                                         50);
	position: absolute;
	top: 0;
	left: 0;
	moz-opacity: 0.8;
	opacity: .80;
	z-index: 49;
	display: none;
}

#id2 {
	top: 200px;
	position: absolute;
	z-index: 50;
	display: none;
	border: 3px solid #E5E5E5;
	left: 100px;
	background-color: white;
}
</style>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<script language="javascript" type="text/javascript">
		function show(){
			id1.style.height=document.body.scrollHeight+"px";
			id1.style.width=document.body.scrollWidth+"px";
			id1.style.display='block';
			id2.style.display='block';
		}
		function hide(){
			id1.style.display='none';
			id2.style.display='none';
		}
	</script>
	</head>
	<body>
		<%
		String way = request.getParameter("way");
		%>
		<html:form action="/modifyatom.do">
			<%
			if (way.equals("1")) {//list 列出已经存在的原子组
			%>
			<table border="0" width="700" align="center" cellpadding="3"
				cellspacing="1" bgcolor="#FF9900">
				<tr>
					<th>
						原子标签
					</th>
					<th>
						原子组名
					</th>
					<th>
						原子组描述
					</th>
					<th>
						<a href="modifyatom.do?way=1&operation=list">新增</a>
					</th>
				</tr>
				<logic:iterate name="allGroupList" id="i">
					<tr bgcolor="ffffff">
						<td class="alt">
							<logic:iterate name="allBookmark" id="j">
								<logic:equal name="j" property="BOOKMARK_ID" value="${i.BOOKMARK_ID}">
									<bean:write name="j" property="BOOKMARK_NAME" />
								</logic:equal>
							</logic:iterate>
						</td>
						<td class="alt">
							<bean:write name="i" property="ATOM_GROUP_NAME" />
						</td>
						<td>
							<bean:write name="i" property="ATOM_GROUP_DESC" />
						</td>
						<td>
							<a
								href="modifyatom.do?operation=modbox&way=1&checkid=<bean:write name="i" property="ATOM_GROUP_ID"/>">查看<br> </a>
						</td>
					</tr>
				</logic:iterate>
				<%
				}
				%>
			</table>
			<% if (way.equals("2")) {//列出已经存在的原子 %>
			<center>
				<div id="tbl-container">
					<table width="100%" id="tbl" border="0" align="center" cellpadding="0" cellspacing="1">
						<thead>
							<tr height="20">
								<th width="16%">
									原子名称
								</th>
								<th width="8%">
									原子类别
								</th>
								<th width="30%">
									代码来源表
								</th>
								<th width="30%">
									基础数据来源表
								</th>
								<th width="8%">
									单位
								</th>
								<th width="8%">
									<a href="modifyatom.do?way=2&operation=list">新增</a>
								</th>
							</tr>
						</thead>
						<tbody>
							<logic:iterate name="allList" id="i">
								<tr bgcolor="ffffff" height="22">
									<td>
										<bean:write name="i" property="BIZ_ATOM_NAME" />
									</td>
									<td>
										<logic:equal name="i" property="ATOM_KIND_ID" value="1">客户</logic:equal>
										<logic:equal name="i" property="ATOM_KIND_ID" value="2">用户</logic:equal>
										<logic:equal name="i" property="ATOM_KIND_ID" value="3">通用</logic:equal>
									</td>
									<td>
										<bean:write name="i" property="CDE_SRC_TABLE_NAME" />
									</td>
									<td>
										<bean:write name="i" property="BAS_TABLE_NAME" />
									</td>
									<td>
										<bean:write name="i" property="BIZ_ATOM_FLAG" />
									</td>
									<td>
										<a href="modifyatom.do?operation=modbox&way=2&checkid=<bean:write name="i" property="BIZ_ATOM_ID"/>">查看</a>
									</td>
								</tr>
							</logic:iterate>
						</tbody>
					</table>
				</div>
			</center>
			<% } %>
				<br>
				<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FF9900">
					<tr>
						<td><div id=groupdiv>原子组名 ：</div></td>
						<td>
							<%
							if (way.equals("1")) {
							%>
							<html:select property="prename">
								<html:option value="">请选择原子标签</html:option>
								<logic:iterate name="allBookmark" id="bm">
									<html:option value="${bm.BOOKMARK_ID}">${bm.BOOKMARK_NAME}</html:option>
								</logic:iterate>
							</html:select>
							<html:errors property="prename" />
							<% } if (way.equals("2")) { %>
							<html:select property="prename">
								<html:option value="">请选择原子组</html:option>
								<logic:iterate name="allGroupList" id="i">
									<option value=<bean:write name="i" property="ATOM_GROUP_ID"/>>
										<bean:write name="i" property="ATOM_GROUP_NAME" />
									</option>
								</logic:iterate>
							</html:select>
							<% } %>
						</td>
					</tr>
					<tr>
						<td>ID：</td>
						<td>
							<html:text property="BIZ_ID" />
							<html:errors property="BIZ_ID" />
						</td>
					</tr>
					<tr>
						<td><div id=namediv>原子名称 ：</div></td>
						<td>
							<html:text property="name" />
							<html:errors property="name" />
						</td>
					</tr>
					<tr>
						<td><div id=BIZ_DESCdiv>原子描述 ：</div></td>
						<td>
							<html:text property="BIZ_DESC" />
							<html:errors property="BIZ_DESC" />
						</td>
					</tr>
				</table>
				<%
				if (way.equals("2")) {
				%>
				<div id="addatominfo">
					<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
						<tr>
							<td>值类型:</td>
							<td>
								<html:select property="VALUE_TYPE_ID">
									<option value="1">数字型</option>
									<option value="2">字符型</option>
								</html:select>
							</td>
						</tr>
						<tr>
							<td>展示方式：</td>
							<td>
								<html:select property="SHOW_TYPE_ID">
									<logic:iterate id="showtype" name="atomShowType">
										<option
											value="<bean:write name="showtype" property="SHOW_TYPE_ID"/>">
											<bean:write name="showtype" property="SHOW_TYPE_NAME" />
										</option>
									</logic:iterate>
								</html:select>
							</td>
						</tr>
						<tr>
							<td>代码来源表：</td>
							<td><html:text property="CDE_SRC_TABLE_NAME"></html:text></td>
						</tr>
						<tr>
							<td>基础数据来源表：</td>
							<td><html:text property="BAS_TABLE_NAME"></html:text></td>
						</tr>
						<tr>
							<td>基础表字段名：</td>
							<td><html:text property="BAS_TABLE_COL_NAME"></html:text></td>
						</tr>
						<tr>
							<td>基础表字段类型：</td>
							<td><html:text property="BAS_TABLE_COL_TYPE"></html:text></td>
						</tr>
						<tr>
							<td>业务原子类别标识：</td>
							<td>
								<html:select property="ATOM_KIND_ID">
									<option value="2">只适用于客户</option>
									<option value="1">只适用于用户</option>
									<option value="3">适用于两者</option>
								</html:select>
							</td>
						</tr>
						<tr>
							<td>原子单位标志：</td>
							<td>
								<html:select property="BIZ_ATOM_FLAG">
									<option value="money">金额</option>
									<option value="time">时长</option>
									<option value="count">次数</option>
									<option value="other">其他</option>
								</html:select>
							</td>
						</tr>
						<tr>
							<td>源表中文字段名：</td>
							<td><html:text property="SRC_TABLE_COL_NAME" /></td>
						</tr>
					</table>
				</div>
				<%
				}
				%>
				<center>
					<img src='images/button_true.gif' width="63" height="21" onclick="document.forms[0].submit();" />
					&nbsp;&nbsp;
					<img src='images/button_cancel.gif' width="63" height="21" onclick="" />
				</center>
			
			<html:hidden property="operation" value="add" />
			<input type="hidden" name="way" />
			<input type="hidden" name="condition" />
		</html:form>
		
		<script type="text/javascript">
			var wayop=<%=way%>;
			document.all.way.value=wayop;
			if(wayop=="1"){
				document.all.groupdiv.innerText="所属原子标签:";
				document.all.namediv.innerText="原子组名称:"
				document.all.BIZ_DESCdiv.innerText="原子组描述:"
			}
			if(wayop=="2"){
				document.all.groupdiv.innerText="所属原子组:";
				document.all.namediv.innerText="原子项名称：";
				document.all.BIZ_DESCdiv.innerText="原子项描述：";
			}
		</script>
	</body>
</html>

